/**
 * 
 */
package com.appcheck.recording.action.impl;

import org.json.JSONException;
import org.json.JSONObject;

import com.appcheck.recording.action.AbstractAction;
import com.appcheck.recording.action.ActionConvert;
import com.appcheck.recording.handler.AbstractActionHandler;
import com.appcheck.recording.plugin.AbstractActionConverter;

public class ItemClickAction implements AbstractAction, ActionConvert {
	
	private int line;//在父view中的位置
	private String parentResourceName;
	private int parentResourceId;
	private boolean longClick;
	
	public final String toString(){
		JSONObject localJSONObject = new JSONObject();
	    try{
	      localJSONObject.put("class", "ItemClickAction");
	      localJSONObject.put("line", this.line);
	      localJSONObject.put("parentResourceName", this.parentResourceName);
	      localJSONObject.put("parentResourceId", this.parentResourceId);
	      localJSONObject.put("longClick", this.longClick);
	    }
	    catch (JSONException localJSONException) {}
	    return localJSONObject.toString();
	}
	
	
	public ItemClickAction(String parentResourceName,
			int parentResourceId, int line, boolean longClick) {
		super();
		this.line = line;
		this.parentResourceName = parentResourceName;
		this.parentResourceId = parentResourceId;
		this.longClick = longClick;
	}

	
	public ItemClickAction() {
		super();
	}


	public final int getParentResourceId() {
		return parentResourceId;
	}

	public final void setParentResourceId(int parentResourceId) {
		this.parentResourceId = parentResourceId;
	}

	public final int getLine(){
		return this.line;
	}

	public final void setLine(int line) {
		this.line = line;
	}

	public final void setLongClick(boolean longClick) {
		this.longClick = longClick;
	}

	
	public final boolean isLongClick() {
		return longClick;
	}

	public final String getParentResourceName() {
		return parentResourceName;
	}



	public final void setParentResourceName(String parentResourceName) {
		this.parentResourceName = parentResourceName;
	}



	@Override
	public boolean handle(AbstractActionHandler param) {
		return param.visit(this);
	}



	@Override
	public void toTestCode(AbstractActionConverter actionConverter) {

	}


}
